#!/usr/bin/env bash
dt="`date -d "$d  0 days ago "  "+%Y-%m-%d"`"
mysql -uroot -proot -hhadoop2<<EOF
use oracleanditem;
select CREATEDATE,count(AMOUNT) AS tradeNumber,sum(AMOUNT) as totalAmount
from TBL_ORDER where TRADEID > 0 and CREATEDATE='$dt'
group by CREATEDATE;
EOF